﻿using System.ComponentModel.DataAnnotations;
using YWM.Dto;

namespace PLC.Interface.BaseMenus
{
    public class BaseMenuDto : EntityDto
    {
        [Required(ErrorMessage = "菜单编码不能为空"), RegularExpression(@"^[A-Z][a-zA-Z]{1,49}$", ErrorMessage = "菜单编码格式不正确")]
        public string Code { get; set; }

        [Required(ErrorMessage = "菜单名称不能为空"), StringLength(50, ErrorMessage = "菜单名称不能超过50个字符")]
        public string DisplayName { get; set; }

        [RegularExpression(@"^[A-Z][a-zA-Z]{1,49}$", ErrorMessage = "父级菜单格式不正确")]
        public string ParentCode { get; set; } = string.Empty;

        [StringLength(200, ErrorMessage = "目标不能超过200个字符")]
        public string Target { get; set; }

        public byte Sort { get; set; }

        [StringLength(100, ErrorMessage = "图标不能超过100个字符")]
        public string Icon { get; set; }

        public bool IsActive { get; set; }

        [StringLength(255, ErrorMessage = "描述不能超过255个字符")]
        public string Description { get; set; }
    }
}
